Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Pomna
Creator III
Creator III

Conditional functions

I have an app that calculates billing for customers based on their location for the current month. I customer could be on both locations for the current month. How do I prevent them from being billed twice? Attaches is my code. Thank you

 

 

[Billing Extract]:

Load

text(date(MonthStart(Today()),'MMM'))& Day(MonthStart(Today()))as [Session ID],

Date(MonthStart(Today()), 'D-MMM-YY') as [Session Date],

text(date(MonthStart(Today()),'MMM'))& Day(MonthStart(Today()))& '-'& num(DocumentCounter,000) as [Document Number],

 [Fee Monthly Rate] & '-' & Date([Billing Start Date],'D-MMM-YY') & ' TO ' & Date([Billing End Date],'D-MMM-YY') & ' - ' & [Days for Calculation] & ' NIGHTS' as Description,

"Employee ID" ,

"Last Name" & "First Name" as  [Employee Name],

'41140' as [GG Code],

'425' as [Department Code],

'' as Debit,

[Monthly Fee] as Credit,

Resident [ Fee Billing]

Where [Location Code] ='03';

 

Load

text(date(MonthStart(Today()),'MMM'))& Day(MonthStart(Today())) as [Session ID],

Date(MonthStart(Today()), 'D-MMM-YY') as [Session Date],

text(date(MonthStart(Today()),'MMM'))& Day(MonthStart(Today()))& '-'&  num(DocumentCounter,000) as [Document Number],

 [ Fee Monthly Rate] & '-' & Date([Billing Start Date],'D-MMM-YY') & ' TO ' & Date([Billing End Date],'D-MMM-YY') & ' - ' & [Days for Calculation] & ' NIGHTS' as Description,

"Employee ID" ,

"Last Name" & "First Name" as  [Employee Name],

'41140' as [GG Code],

'425' as [Department Code],

'' as Debit,

[Monthly  Fee] as Credit,

Resident [Fee Billing]

Where [Location Code] ='04';

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

You Can use the "Exists" function to remove the customers from the second table.

Exists function will help you not load the customer information which is already loaded above.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

You Can use the "Exists" function to remove the customers from the second table.

Exists function will help you not load the customer information which is already loaded above.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Pomna
Creator III
Creator III
Author

Thank you