Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

no data replace 0


if there is no data end set the value to zero.I need the hellp pn this for a calculation.

if net balance dnt ave data then we should get 0 so tha in comupaion of

balance-net balance we get, blance-0=balance

Regards,

Prajna

22 Replies
Not applicable
Author

table 1:(Transaction table)

ID   Date      Netbalance

1     12 apr     50

1      13apr     89

1      16apr     56

1     17apr     78

2     18apr     90

1     19APR     98

2     20apr      89

table 2:(BALANCE)

ID           Balance

1               450

2               79

Both table are linked by ID ,ID in balance table is PK

Whereas FK in transaction table

MK_QSL
MVP
MVP

Let me go to some more depth....

Here for ID = 1

Balance = 50

If you want Total

ID   Date      Netbalance TOTAL1      TOTAL2   

1     12apr     50                450-50     450-50

1     13apr     89                450-89     450-50-89

1     16apr     56                450-56     450-50-89-56

1     17apr     78

1     19apr    98

Which TOTAL you want? 1 or 2?

Not applicable
Author

okay i will tell u exactly  what i want..which bit complex

u have 2 tables transacion and balance

transaction for everyday activity and balace is recorded at the end of day.

transaction table : we have date ,balance id,cresdits,debits and net

balance table we have : balance id,balance amount

transaction table is

ID   Date      Netbalance

1     12 apr     50

1      13apr     89

1      16apr     56

1     17apr     78

2     18apr     90

1     19APR     98

2     20apr      89

balance table has one record for each balacne id.it always hold currenct balance

my req is to show total balance for all dates.if there is no transaction then i need to find what is he possible balance for that particular day.

now question is how will i find balance on that day?

i need to collect balance amt frombalance table that would be for currenct day and subtract with net balance to obtain my balnce on previous day.

Ex:   balance    credits debits  net

if i have credited 100 on 12 th apr then,

100     100     -      100

if credited 200,13apr

300     200     -     200

if debited 100,15 apr

Bal     cre     deb     net

200     -     100     -100

but in actual table balance value willl be over ridden

we have only 200in balance and there is no date field

if i want to knw what was the balnce on 14  apr

then i need to take balance amount from balance table that would be for currenc date say 18th apr

200 in example

subtract that witrh 18th apr net..as we dnt have record it should be 0 for 18th

so balance on 18 is 200-0=200

then on 17th,200-0=200

on 16th 200-0=200

on 15th 200-(-100)=300

on 14th its 300-0=300 so we go the balance on 14 th apr.

This is what i wanted.Hope its clear.

Can u help me further on  this

Thank you

Regards,

Prajna

manojkulkarni
Partner - Specialist II
Partner - Specialist II

go thru this link http://community.qlik.com/docs/DOC-3786

you can achieve the solution by creating missing values.

MK_QSL
MVP
MVP

I am sorry but it's difficult to work without data....

Can you provide sample data in excel file? This is necessary to get answer quickly as it's difficult to create  dummy data for such questions.

Not applicable
Author

hi,

I have attached some sample data.Waiting for your solution and suggestions:)

Regards,

Prajna

MK_QSL
MVP
MVP

Not Clear... can you provide your final result table in excel file based on the two excel files you have provided.

Not applicable
Author

Hi,

There is no result table.from the two tables i need to showcase in dashboard.

Total balance for each day.

Is it possible?

Regards,

Prajna

Not applicable
Author

Hi Prajna,

Try Below :

Calander Table :

//Contains all dates i.e. all 365 days of year.

C_NB Alias_ID Date

0          111          01.01.2000

0          111          02.01.2000

0          111          03.01.2000

....

;

Balance:

Alias_ID ID Balance

111          1    400

111          2    500

111          3    600

...

;

Transaction:

ID  Date                 NB

1   01.01.2000      15

3   05.01.2000      18

...

;

Now in the Table Chart Take ID from Balance Table and Date from Calander Table as dimension

in Expression use =Balance - if(NB = '', C_NB,NB)

I hope this will solve your problem. I havn't tried request you to kindly try and let us know if this works.

Thanks & Regards

Suhas Gupta

Not applicable
Author

Hi,

Howw to generate alias id in calender?

and is it feasivble to alter table structure by adding a new column to existing table balance?

Thank  you

Regards,

Prajna