Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Error in script

Hey, My script is:

=if(GetSelectedCount(_CalendatType) = 0 , $(vSalesbookUsage) ,

if(_CalendarType = 'Fiscal' , GetFieldSelections([TradeFiscalYear]) & '-' & GetFieldSelections([TradeFiscalQuarter]) ,

if(vTradeCalendarType = '1D' , date(max(){1}TradeDateMaster), 'MM/DD/YYY'),

if(vTradeCalendarType = 'Custom' , Date($(vTradeStartDate) , 'MM/DD/YYYY') & '-' & Date($(vTradeEndDate) , 'MM/DD/YYYY')))))

where, vSalesbookUsage = SalesBookUsage.

But issue is whenever i clear everything sometimes SalesbookUsage in straight table caption is not shown. Last Selected Date is shown. ALso when i reopen the file, last selected date is shown while it should show SalesBookUsage.

What to do??

Thanks

1 Solution

Accepted Solutions
sunny_talwar

You can set a on open trigger within the document properties which essentially clears your selection for your date field.

HTH

Best,

Sunny

View solution in original post

14 Replies
Not applicable

Hi,

Is the script copy-paste from your application?   In the first line you have _CalendatType   ...with a t.

// Fjalar

nikhilgarg
Specialist II
Specialist II
Author

Well,

It is a typing mistake(Typo). Can you please tell what to do because whenever i reopen the document it shows last time selected date while i want if no date is selected or if we reopen document then SalesbookUsage should be written at caption of straight table.

Thanks

sunny_talwar

You can set a on open trigger within the document properties which essentially clears your selection for your date field.

HTH

Best,

Sunny

nikhilgarg
Specialist II
Specialist II
Author

Thanks sunny,

it helped

sunny_talwar

Awesome, I am glad it was useful.

Best,

Sunny

nikhilgarg
Specialist II
Specialist II
Author

Hey sunny,

Actually i am not allowed to del the trigger so is there any other way to acheive the same??

sunny_talwar

Hey Nikhil,

So you are trying to clear a field without using a trigger? Is that what your requirement is?

Best,

Sunny

nikhilgarg
Specialist II
Specialist II
Author

Yes, actually i want when i open the doc in straight table's caption , Salesbook usage should be visible when no date is selected. But due to trigger by default calendar is selected.

nikhilgarg
Specialist II
Specialist II
Author

Hey btw let say i have 2 tables with 2 common columns. I load one table

then voncatenate with other same columns table. Now i want to remove

duplicate columns also. What can we do for this?

Thanks