Monday, 11 October 2021

Making local machine as hub server

 open command prompt


open the drive where u have downloaded the standalone server file


Lets say E:

E:\java -jar selenium-server-standalone-3.141.59.jar -role hub



Copy the node link and clients link

Nodes should register to http://192.168.192.1:4444/grid/register/

Clients should connect to http://192.168.192.1:4444/wd/hub


Monday, 1 March 2021

Google Sheets - Dependent Drop Down List for Entire Column, Multiple Levels

 

  var mainWsName = "Master";
  var sourceWsName = "Slave";

    var firstLevelColumn = 1;
   var secondLevelColumn = 2;
   var thirdLevelColumn = 3;
  var ws = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(mainWsName);
  var wsOptions = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sourceWsName);

  var optionswsOptions.getRange(2,1,wsOptions.getLastRow()-1,3).getValues();
 

/*function myFunction() {

  var list = ["a","b","c"];
  var cell = ws.getRange("C2");
  applyValidationToCell(list,cell);
}*/


function onEdit(e){
  var activeCell=e.range;

  var valactiveCell.getValue();
  var r=activeCell.getRow();
  var c =activeCell.getColumn();
  var wsNameactiveCell.getSheet().getName();
  if (wsName === mainWsName && c === firstLevelColumn && r > 1){
applyFirstLevelValidation(val,r);
else if(wsName === mainWsName && c === secondLevelColumn && r > 1){}
applySecondLevelValidation(val,r);

}

function applyFirstLevelValidation(val,r){
  
  if (val === ""){
  ws.getRange(r,secondLevelColumn).clearContent();
  ws.getRange(r,secondLevelColumn).clearDataValidations();
 
}else{
ws.getRange(r,secondLevelColumn).clearContent();
  var filterOptions=  options.filter(function(o){return o[0]=== val});
  var listToApply = filterOptions.map(function(o){return o[1]});

var cell = ws.getRange(r,secondLevelColumn);
  applyValidationToCell(listToApply,cell);}
}

function applySecondLevelValidation(val,r){
  
  if (val === ""){
  ws.getRange(r,thirdLevelColumn).clearContent();
  ws.getRange(r,thirdLevelColumn).clearDataValidations();
 
}else{
ws.getRange(r,thirdLevelColumn).clearContent();
var firstLevelColValuews.getRanger,firstLevelColumn).getValue();
  var filterOptions=  options.filter(function(o){return o[0]=== firstLevelColValue && o[1] === val});
  var listToApply = filterOptions.map(function(o){return o[2]});
  
var cell = ws.getRange(r,thirdLevelColumn);
  applyValidationToCell(listToApply,cell);}
}

function applyValidationToCell(list,cell) {

  var rule=SpreadsheetApp
  .newDataValidation()
  .requireValueInList(list)
  .setAllowInvalid(false)
  .build();
  
  cell.setDataValidation(rule);
}

Sunday, 14 February 2021

Taking uniqure value from three different columns

 =UNIQUE({K5:K80;L5:L80;M5:M80})

sort in ascending order the transponsed unique dates

 =TRANSPOSE(sort(UNIQUE($L$2:$L$5001),1,true))

Importrange to import large data

 =QUERY({IMPORTRANGE("1ZTtsquwfJIlTJisS7gD_13u4Evfcz4Nr-T9N9p3-SYQ/edit#gid=847332267","Action Data!$A$23000:$H$54002");

IMPORTRANGE("1ZTtsquwfJIlTJisS7gD_13u4Evfcz4Nr-T9N9p3-SYQ/edit#gid=847332267","Action Data!$A$54003:$H$78005")}, 

"select Col2,Col4,Col5,Col8 where Col1='"&B32&"' and Col3= '"&B11&"' and Col2 >= Date '"&TEXT(A2,"yyyy-MM-dd")&"' and Col2 <= Date '"&TEXT(B2,"yyyy-MM-dd")&"'")

How to use Google query with "order by"

 =QUERY(IMPORTRANGE("1ZTtsquwfJIlTJisS7gD_13u4Evfcz4Nr-T9N9p3-SYQ/edit#gid=620793866","Call Data!$B$20000:$K$40000"),"select Col4,Col5,Col10 where Col1= '"&B40&"'and Col4 >= Date '"&TEXT(A2,"yyyy-MM-dd")&"' and Col4 <= Date '"&TEXT(B2,"yyyy-MM-dd")&"' order by Col4",0)