aarav021
Contributor III
2022-12-07
12:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can anyone tell me what's wrong in this Qlik Sense expression
Hi I am new to Qlik Sense. Can anyone please help me with currect solution to this as this is an urgent requirement.
LOAD
if(Year(max(FISCAL_YEAR))=Year(Today()),
Year(max(FINANCIAL_YEAR))) as Curr_FY,
if(Year(max(FISCAL_YEAR))=Year(Today()),
Year(today()-1)) as Prev_FY
Resident [data_table];
Let Current_FY = '=Curr_FY';
Let Last_FY = '=Prev_FY';
I want to create a dynamic variable in load editor for current fiscal year and previous fiscal year. So that I use it in table chart.
Labels (7)
Labels
- Subscribe by Topic:
-
Chart
-
Data Load Editor
-
dimension
-
expression
-
Script
-
Set Analysis
-
Variables
516 Views
1 Reply
RafaelBarrios
Partner - Specialist
2022-12-07
05:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @aarav021
if your data table has only one single row or you just need one record, you will need to use peek
your_new_table_name:
LOAD
if(Year(max(FISCAL_YEAR))=Year(Today()),
Year(max(FINANCIAL_YEAR))) as Curr_FY,
if(Year(max(FISCAL_YEAR))=Year(Today()),
Year(today()-1)) as Prev_FY
Resident [data_table];
let Current_FY = Peek('Curr_FY',0,'your_new_table_name')
but if table is bigger or need to read more records, you will need to use a WHILE or FOR to read it
Hope this helps.
Best,
help users find answers! Don't forget to mark a solution that worked for you & to smash the like button! 😁
490 Views