Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Harish_Qlik
Contributor II
Contributor II

Convert Selected date into number

Hi,

is there any way to convert selected date into numeric? i want to convert 'GetFieldSelected(date,';')' into a number format?

i tried 'num(GetFieldSelected(Activitymonth,';'))' but its not working.

Labels (3)
14 Replies
Harish_Qlik
Contributor II
Contributor II
Author

Hi, 

yes i am using current selection in a variable by using  if(GetSelectedCount(ReportingMonth)=0,MonthName(AddMonths(Today(),-1)),GetFieldSelections(ReportingMonth,';')), and in sheet action i am reffering to this variable, 

could you please advice how make dynamic default bookmark that makes sure that the app opens with previous month selected, but after that it's up to what the users selects??

henrikalmen
Specialist II
Specialist II

Ok, but GetFieldSelections(ReportingMonth,';') will give you a semi-colon separated string.How do you use the variable to make it into a new selection? You say you are "reffering to the variable", but how?

See this support video on how to create dynamic default bookmark: https://help.qlik.com/en-US/video/tFyqOigqnUw

lennart_mo
Creator II
Creator II

Hi @Harish_Qlik,

do you set your variable by evaluating this equation?

If not, do so:

'$(=if(GetSelectedCount(ReportingMonth)=0,MonthName(AddMonths(Today(),-1)),GetFieldSelections(ReportingMonth,';')))'

And afterwards put your variable in the 'Select Values in a field'-action like so:

='$(yourVariable)'

Evaluating your equation is important, because that way the string is set before you delete the user-made selections. The syntax in the second step keeps the value of the variable as a string, needed to make the right selections.

Let me know if this worked for you!

Harish_Qlik
Contributor II
Contributor II
Author

Hello Lennart

 

the above solution is working only when i select 'Select values matching search criteria' but no in 'Select values from a field' because the above syntax only return string value, and 'Select values from a field' is only accept numeric values, and the sheet action is working only when user select one date value, if multiple date values being selected then the sheet action doesn't work and selection for a sheet automatically disappeared.

Harish_Qlik
Contributor II
Contributor II
Author

Hi all,

Thank you for all your support, now finally i am able get what i was looking for..

here is the solution I have applied:-

First, i created a variable with the expression =if(GetSelectedCount(Reportingmonth)=0,num(MonthName(AddMonths(Today(),-1))),Concat(distinct(num(Reportingmonth)),';')) 

and in the sheet action, i choose in the action 'Select values in a field', and in the field section i choose reporting month field, and in the values expression i mentioned the variable name.

the variable will return the default value(which is previous month) upon landing, and whatever i change the selection in the sheet it is carried forward to next sheet.

 

thanks ones again.