Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to calculate % 1 to 30 days and 31 to 60 days and so on

Hi Friends,

i have a Query , need to Calculate rate of interest for 1- 30 days

and 31 to 60 days

and 61 -180 days and

181 to 360 days

360+ days .

need to calculate on  my column name is tot_cust  Expression column.

appreciated you if elaborated  in detail manor it is urgent. i am waiting for your replay.

Regards,

Siva.

4 Replies
varshavig12
Specialist
Specialist

Can you provide us with sample data ?

jonathandienst
Partner - Champion III
Partner - Champion III

If you would like detailed and specific help, then you need to supply a small representative sample qvw. It need not contain any sensitive information (scramble or exclude fields), but it must contain the structure and some sample data to work with.

Preparing examples for Upload - Reduction and Data Scrambling

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anil_Babu_Samineni

If you have date field, Then you may convert like below

Date Format is DD-MM-YYYY

Load *, Date(Date, 'DD/MM/YYYY') as Date, Year(Date) as Year Inline [

Date, tot_cust

01-01-1889, 1

........

07-11-2016, 10

];

Then Create Funnel Chert Object Like Below to show the Buckets / Interaction Match

Dimension is

If(Day(Date) >= '1' and Day(Date) <= '30', Dual(1, '1 - 30 Days'),

If(Day(Date) >= '31' and Day(Date) <= '60', Dual(2, '31 - 60 Days'),

If(Day(Date) >= '61' and Day(Date) <= '180', Dual(3, '61 - 180 Days'),

If(Day(Date) >= '181' and Day(Date) <= '360', Dual(4, '181 to 360 Days'),

If(Day(Date) >= '360', Dual(5, '360+ Days'))))))


Then Use This Expression


Sum({<Year = {"$(=Max(Year))"}, Day, >} TOTAL <

If(Day(Date) >= '1' and Day(Date) <= '30', Dual(1, '1 - 30 Days'),

If(Day(Date) >= '31' and Day(Date) <= '60', Dual(2, '31 - 60 Days'),

If(Day(Date) >= '61' and Day(Date) <= '180', Dual(3, '61 - 180 Days'),

If(Day(Date) >= '181' and Day(Date) <= '360', Dual(4, '181 to 360 Days'),

If(Day(Date) >= '360', Dual(5, '360+ Days'))))))

> tot_cust)


Or Else, You would read Jonathan Link. How to Upload Sample with scramble Data.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hi Siva,

Create one dimension in your script level as following

If(Day(Date) >= '1' and Day(Date) <= '30', Dual(1, '1 - 30 Days'),

If(Day(Date) >= '31' and Day(Date) <= '60', Dual(2, '31 - 60 Days'),

If(Day(Date) >= '61' and Day(Date) <= '180', Dual(3, '61 - 180 Days'),

If(Day(Date) >= '181' and Day(Date) <= '360', Dual(4, '181 to 360 Days'),

If(Day(Date) >= '360', Dual(5, '360+ Days')))))) as Days Interval


and now use this dimension in your pivot table and in expression put sum(tot_cust) for your desired outcome.


Thanks,