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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
RenewalBIUser
Contributor III
Contributor III

Using GetFieldSelections in Dynamic Replace Function

Hello,

I currently use a replace function in Qlik Sense to allow users to select KPIs from a List Box from dynamic expressions in my load script.  EventType is common in all of my formulas so I use a replace function to add in different time flags.

$(=replace(only({1<FormulaOrder={"$(=min(FormulaOrder))"}>} Formula), 'EventType', 'CurrentYearToDate = {1}, EventType'))

I've recently added the date range picker extension and want to leverage the user selection range for current and prior year calculations.

I was thinking I may be able to leverage the GetFieldSelections and a replace function to get what I need.  On top of that I would need to add it into the existing replace function I already use.

I was thinking I could combine the above with this type of replacement but I'm not even close to getting it to work.

replace((GetFieldSelections(CalendarDate)),'Year(Today())','Year(Today())-1')

End goal would look something like this

$(=replace(only({1<FormulaOrder={"$(=min(FormulaOrder))"}>} Formula), 'EventType', 'CalendarDate =replace((GetFieldSelections(CalendarDate)),[Year(Today())],'Year[Today())-1]), EventType'))


Any ideas?


Thanks!

0 Replies