Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Naresh1
Contributor III
Contributor III

Qliksense table fields values equal, positive, negative

Hi,

I  have three fields in qliksense table in those three fields names are voucher type, original amount, outstanding amount,

outstanding amount and original amount fields having some common values negative, positive and equal values

they given 4 conditions for these

1. original amount = outstanding amount (positive amount), voucher type other than payment

2.outstanding amount less than original amount (positive amount)

3. original amount = outstanding amount (positive amount), voucher type payment

4. outstanding amount greater than or equal to original amount (negative amount)

all these conditions i want to show  in qliksense table 

previously i am posted few questions, i got answers from them with in day 

but this one question, i dont get any answer,is it possible?

Thanks,

 
 
7 Replies
Vegar
Partner
Partner

I found it hard to understand all your definition without a sample and a desired output, but I'm guessing that the correct expression for no 1. is the following.

=Sum({<[voucher type]={"= [voucher type]<> 'Payment'"}>}[original amount])

 

Could you create a sample similar to this and also what's the desired output for the four expression on that dataset? It will make it easier to help you with the rest.

Sample:
LOAD * inline [
 Voucher type, 	Original amount,Outstanding amount
 Payment, 		1000,			1000
 Credit, 		-3000, 			0
 Bank , 		-3000, 			-1000
 ];

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Naresh1
Contributor III
Contributor III
Author

Please see the below sample excel table

Same This  table i want to load in Qliksense

And also given conditions order wise how the values should come

Vegar
Partner
Partner

I did not really understand your excel either, I tried to restructure it? Is it correct? Please adjust and add info on what you are expecting for output. 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Naresh1
Contributor III
Contributor III
Author

see the below excel table

Vegar
Partner
Partner

Take a look at my output and expression below. Notice the colored line that do get any classification as it does not meet  any condition

image.png

DATA:
LOAD *,
IF(
	[voucher type] = 'other than payment' and [original amount]=[outstanding amount] AND [original amount]>=0,
	1,
	IF(	[voucher type] = 'payment' and [original amount]=[outstanding amount] AND [original amount]>=0, 
		4,
		IF(	[original amount]>=[outstanding amount]  AND [original amount]<0,
			3,
			IF(	[original amount]>[outstanding amount]  AND [original amount]>=0,
				2,
				0
			)
		)
	)
) as Class;
LOAD * inline [
voucher type	original amount	outstanding amount	Condition?
other than payment	20000	20000	1. original amount = outstanding amount (positive amount), voucher type other than payment
other than payment	10	10	1. original amount = outstanding amount (positive amount), voucher type other than payment
						
payment	3000	24000	2.outstanding amount less than original amount (positive amount)
payment	2300	2100	2.outstanding amount less than original amount (positive amount)
						
payment 	-890	-890	3. outstanding amount greater than or equal to original amount (negative amount)
other payment	-200	-300	3. outstanding amount greater than or equal to original amount (negative amount)
						
payment	600	600	4. original amount = outstanding amount (positive amount), voucher type  payment
payment	7800	7800	4. original amount = outstanding amount (positive amount), voucher type payment

] (delimiter is '	');

  

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Naresh1
Contributor III
Contributor III
Author

Sorry, its not 3000 , its 30000 thanks for your response 

Naresh1
Contributor III
Contributor III
Author

Hi Vegar,

I am loaded base table in database to qliksense, i want output exactly like in below excel table to  qliksense table

in base table having all fields like excel,

but i dont need conditional field in qliksense

i want only that conditions should apply to this fields only  'original amount', 'outstanding amount', 'voucher type'

in voucher type having credit, debit, voucher, receipts, other payment